package util;


import com.alibaba.fastjson.JSON;

/**
 * @Author: yangyan
 * @Date: 16:14 2017/10/20
 * @Description:
 */
public class ResponseUtil {
    private Integer error;
    private String message;

    private Object data;

    public Integer getError() {
        return error;
    }

    public void setError(Integer error) {
        this.error = error;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static String getResponseString(Integer errorCode, String message, Object data) {
        ResponseUtil response = new ResponseUtil();
        response.setError(errorCode);
        response.setMessage(message);
        response.setData(data);
        return JSON.toJSONString(response);
    }
}
